﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using JBeamLibrary.VehicleParts.Enums;

namespace JBeamLibrary.VehicleParts.Collections
{
    public static class NodePropertyTypes
    {
        public static readonly IDictionary<NodeProperties, Type> List = new Dictionary<NodeProperties, Type>()
        {
            { NodeProperties.Group,         typeof(string)      },
            { NodeProperties.SelfCollision, typeof(bool)        },
            { NodeProperties.Collision,     typeof(bool)        },
            { NodeProperties.NodeMaterial,  typeof(NodeMaterial)},
            { NodeProperties.FrictionCoef,  typeof(float)       },
            { NodeProperties.NodeWeight,    typeof(float)       }
        };

        public static Type GetPropertyType(NodeProperties prop)
        {
            return List.FirstOrDefault(pair => pair.Key == prop).Value;
        }

        public static NodeProperties GetNodeProperty(Type propertyType)
        {
            return List.FirstOrDefault(pair => pair.Value == propertyType).Key;
        }
    }
}
